home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
47215
/
47215.xpi
/
chrome
/
content
/
lib
/
sharedMemory.js
< prev
next >
Wrap
Text File
|
2009-11-22
|
2KB
|
43 lines
(function()
{
//returns true if a shared object created by a XPCOM exists (shared by all the windows of the same browser instance (profile))
this.sharedObjectExists = function(objectName)
{
var sharedObjectComponent = Components.classes['@particle.universe.tito/SharedObject;1']
.getService().wrappedJSObject;
return sharedObjectComponent.sharedObjectExists('URLtoTabTitle.'+objectName);
}
//returns a shared object stored in a XPCOM (shared by all the windows of the same browser instance (profile))
this.sharedObjectGet = function(objectName, aDefault)
{
var sharedObjectComponent = Components.classes['@particle.universe.tito/SharedObject;1']
.getService().wrappedJSObject;
if(this.sharedObjectExists(objectName))
{
//this.dump('sharedObjectGet:The shared var "'+objectName+'" is a property of the XPCOM');
}
else
{
//this.dump('sharedObjectGet:The shared var "'+objectName+'" is NOT a property of the XPCOM');
if(!aDefault && aDefault !== 0)
{
//this.dump('sharedObjectGet:The shared var "'+objectName+'" doenst have a default value');
aDefault = {};
}
else
{
//this.dump('sharedObjectGet:The shared var "'+objectName+'" has a default value');
}
//this.dump('sharedObjectGet:The shared var "'+objectName+'" was stored as a property of the XPCOM');
sharedObjectComponent.sharedObjectSet('URLtoTabTitle.'+objectName, aDefault);
}
//this.dump('sharedObjectGet:The property "'+objectName+'" was retrieved from the XPCOM');
return sharedObjectComponent.sharedObjectGet('URLtoTabTitle.'+objectName);
}
return null;
}).apply(URLtoTabTitle);